package com.dogcatfishdish.depthdisplay 
{
	import com.greensock.easing.Quad;
	import com.greensock.OverwriteManager;
	import flash.display.Sprite;
	
	/**
	 * ...
	 * @author bb
	 */
	public class DragContainer extends Sprite
	{
		public var zMin:Number = 1;
		public var zMax:Number = 20;
		public var upDuration:Number = 0.1;
		public var downDuration:Number = 0.2;
		public var upEase:Function = Quad.easeOut;
		public var downEase:Function = Quad.easeIn;
		public var snapToTarget:Boolean = true;
		public var returnToBase:Boolean = true;
		
		public var targets:Array = [];
		
		public function DragContainer() 
		{
			super();
			OverwriteManager.init(2);
		}
		
		public function addTargetItem(item:BaseTargetItem):void {
			addChild(item);
			targets.push(item);
		}
		
		
		public function addDragItem(item:DragItem):void {
			addChild(item);
			
			item.container = this;
			item.setInitialPosition();
			
			item.snapToTarget = snapToTarget;
			item.returnToBase = returnToBase;
			item.zMax = zMax;
			item.zMin = zMin;
			item.upDuration = upDuration;
			item.downDuration = downDuration;
			item.upEase = upEase;
			item.downEase = downEase;
		}
		
		public function sortDepth(topItem:DragItem):void {
			setChildIndex(topItem, numChildren - 1);
		}

		
	}

}